
<%@page import="com.liferay.portal.kernel.util.Constants"%>
<%@page import="qldc.pm.qlktcsdldc.actions.ActionHandlerConstant"%>
<%@ include file="../../init.jsp"%>

<%
	String soDinhDanhCaNhan = ParamUtil.getString(request, "soDinhDanhCaNhan");
	System.out.println("soDinhDanhCaNhan: >>>"+soDinhDanhCaNhan);
	
	String linkAccessActive =  ParamUtil.getString(request, "itemNoiDungCon", QLKTCSDLDCContants.PAGEID_XCT_THONG_TIN_CHUNG);
	System.out.println("linkAccessActivelinkAccessActive: >>>"+linkAccessActive);
	
	String redirect = ParamUtil.getString(request, "redirect");
	PortletURL backURL = renderResponse.createRenderURL();
	backURL.setParameter("mvcPath", "/html/qlktcsdldc/quan_ly_dan_cu.jsp");
	backURL.setParameter("tabs1", QLKTCSDLDCContants.PAGEID_QLDC_MAN_HINH_CHINH);
	backURL.setParameter("redirect", redirect);
%>
<portlet:actionURL var="thongTinCongDanInURL">
	<portlet:param name="<%=ActionHandlerConstant.ACTION_HANDLER_PARAM%>" value="<%=ActionHandlerConstant.QUAN_LY_DAN_CU_ACTION%>" />
	<portlet:param name="<%=Constants.ACTION%>" value="thongTinCongDanIn" />
	<portlet:param name="soDinhDanhCaNhan" value="<%=soDinhDanhCaNhan %>"/>
	<portlet:param name="redirect" value="<%=backURL.toString()%>" />
</portlet:actionURL>

<h2 class="tle-Content">
	<liferay-ui:message key="thong-tin-cong-dan" />
</h2>
<div class="main-Content">
	<div class="rightContent">
		<liferay-util:include page="/html/qlktcsdldc/quan_ly_dan_cu/xem_chi_tiet/chon_chuc_nang.jsp" servletContext="<%=this.getServletContext()%>">
		</liferay-util:include>
	</div>
	<div class="leftContent" id="<portlet:namespace/>thong-tin-cong-dan-content">
		 <form name="<portlet:namespace/>fmThongTinCongDan" id="<portlet:namespace/>fmThongTinCongDan" method="POST" enctype="multipart/form-data" action="" onsubmit="return false;">	    		
	   		<div id="<portlet:namespace/><%=QLKTCSDLDCContants.PAGEID_XCT_THONG_TIN_CHUNG%>" class="hidden">
			     <liferay-util:include page="/html/qlktcsdldc/quan_ly_dan_cu/xem_chi_tiet/thong_tin_chung.jsp" servletContext="<%=this.getServletContext()%>">
				</liferay-util:include>
			</div>
			<div id="<portlet:namespace/><%=QLKTCSDLDCContants.PAGEID_XCT_THONG_TIN_HO_KHAU%>" class="hidden">
			    <liferay-util:include page="/html/qlktcsdldc/quan_ly_dan_cu/xem_chi_tiet/thong_tin_ho_khau.jsp" servletContext="<%=this.getServletContext()%>">
				</liferay-util:include>
			</div>
			<div id="<portlet:namespace/><%=QLKTCSDLDCContants.PAGEID_XCT_HOC_VAN_VA_NGHE_NGHIEP%>" class="hidden">
			    <liferay-util:include page="/html/qlktcsdldc/quan_ly_dan_cu/xem_chi_tiet/hoc_van_va_nghe_nghiep.jsp" servletContext="<%=this.getServletContext()%>">
				</liferay-util:include>
			</div>
			<div id="<portlet:namespace/><%=QLKTCSDLDCContants.PAGEID_XCT_QUAN_HE_HUYET_THONG%>" class="hidden">
			    <liferay-util:include page="/html/qlktcsdldc/quan_ly_dan_cu/xem_chi_tiet/quan_he_huyet_thong.jsp" servletContext="<%=this.getServletContext()%>">
				</liferay-util:include>
			</div>
			<div id="<portlet:namespace/><%=QLKTCSDLDCContants.PAGEID_XCT_TINH_TRANG_HON_NHAN%>" class="hidden">
			    <liferay-util:include page="/html/qlktcsdldc/quan_ly_dan_cu/xem_chi_tiet/tinh_trang_hon_nhan.jsp" servletContext="<%=this.getServletContext()%>">
				</liferay-util:include>
			</div>
		</form>
	</div>
</div>

<script type="text/javascript">
 var  itemSelected = '<%=linkAccessActive%>';

window.onload = function(){
	 $(".<portlet:namespace/>chon-chuc-nang-thong-tin-cong-dan li").each(function(i) {
		console.log('chon-chuc-nang-thong-tin-cong-dan li');
		var checkDiv = $(this);
		var linkAccessOfCheckDiv =  checkDiv.children("div").attr('link-access');
		if (linkAccessOfCheckDiv === '<%=linkAccessActive%>'){
			var leftContainerCheckDiv = $('#<portlet:namespace/>thong-tin-cong-dan-content');
    	  	var contentDataCheckDiv = leftContainerCheckDiv.find('#<portlet:namespace/>'+linkAccessOfCheckDiv);
    	  	console.log('contentDataCheckDiv:',contentDataCheckDiv);
    	  	contentDataCheckDiv.removeClass('hidden');
    	  	contentDataCheckDiv.siblings().addClass('hidden');
		}
			
		$(this).click(function() {
				console.log('click 1111');
				var div = $(this);
				div.addClass("active");	   
	    	  	div.siblings().removeClass("active");
	    	  	var linkAccess =  div.children("div").attr('link-access');
	    	  	console.log('click 1111:'+ linkAccess);
	    	  	itemSelected = linkAccess;
	    	  	var leftContainer = $('#<portlet:namespace/>thong-tin-cong-dan-content');
	    	  	console.log('click 1111 leftContainer:'+ leftContainer);
	    	  	var contentData = leftContainer.find('#<portlet:namespace/>'+linkAccess);
	    	  	contentData.removeClass('hidden');
	    	  	contentData.siblings().addClass('hidden');
    	});    	   
	});  
};
function <portlet:namespace/>thongTinCongDanIn(){
	console.log('QLDC_ManHinhChinh_ExportDanCu');
	$("#<portlet:namespace/>fmThongTinCongDan").attr('action', '<%=thongTinCongDanInURL.toString()%>');
	$("#<portlet:namespace/>fmThongTinCongDan").attr('onsubmit', 'return true;');
	$("#<portlet:namespace/>fmThongTinCongDan").submit();
};

function <portlet:namespace/>thongTinCongDanThoat(){
	location.href = '<%=backURL.toString()%>';
}
</script>